#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>


int MyStrlen(char arr[])
{
	char* p = arr;
	int count = 0;
	while (*p != '\0')
	{
		count++;
		p++;
	}
	return count;
}

//void reverse_string(char arr[])
//{
//	int len = MyStrlen(arr);
//	char temp = arr[0];
//	arr[0] = arr[len - 1];
//	arr[len - 1] = '\0';
//	if (MyStrlen(arr + 1) >= 2)
//	{
//		reverse_string(arr + 1);
//	}
//	arr[len - 1] = temp;
//}

void reverse_string(char *arr)
{
	int len = MyStrlen(arr);
	char temp = *arr;
	*arr = *(arr+(len-1));
	*(arr+(len - 1)) = '\0';
	if (MyStrlen(arr + 1) >= 2)
	{
		reverse_string(arr + 1);
	}
	*(arr + (len - 1)) = temp;
}

int main()
{
	char arr[] = "abcdefg";
	reverse_string(arr);
	printf("%s\n", arr);
	return 0;
}